# @Time: 2021/3/3 14:59
# @Athuor: 雷磊
# @Email: 1021010830@qq.com
# @File: setting.py
import os,hashlib

url_RegisterExt = 'http://hn216.api.yesapi.cn/?s=App.User.RegisterExt'
url_UploadAvatar = 'http://hn216.api.yesapi.cn/?s=App.User.UploadAvatar'
url_LoginExt = 'http://hn216.api.yesapi.cn/?s=App.User.LoginExt'

# 服务器相关配置
API_URL = 'http://hn216.api.yesapi.cn/?s=App.{}'
APP_KEY = 'D0B3CE97D27954B8D2F40E16413668AE'
APP_SECRET = 'B6Cgr1ttrWIw9pImLuAp0MmVy0usK6Vpz0kIvJufzoWGpqYyRV1nDlt1'

# 设置目录的绝对路径
BASE_PATH = os.path.dirname(os.path.abspath(__file__))
# yaml 测试用例存放位置
DATA_PATH = os.path.join(BASE_PATH, 'datas')
# unittest 测试类文件存放位置
CASE_PATH = os.path.join(BASE_PATH, 'cases')
# 测试报告路径
REPORT_PATH = os.path.join(BASE_PATH, 'report')


import os

def data_path():
    project_path = os.path.dirname(os.path.dirname(__file__))
    return os.path.join(project_path,"datas")

def case_path():
    project_path = os.path.dirname(os.path.dirname(__file__))
    return os.path.join(project_path,"cases")


import os

"""会员注册URL"""
API_URL_User_register="http://hn216.api.yesapi.cn/?s=App.User.Register"
"""修改会员分组URL"""
API_URL_User_change_role="http://hn216.api.yesapi.cn/?s=App.User.ChangeRole"

import os

# 服务器相关配置
API_URL_xl = 'http://hn216.api.yesapi.cn/'


def set_res_data(res):
    if res:
        return res.lower().replace('":"', '=').replace('":', '=')

def hash_code(passwd):
    md5=hashlib.md5()
    md5.update(passwd.encode('utf_8'))
    return md5.hexdigest()

def set_re_data(res):
    if res:
        return res.replace('":"', '=').replace('":', '=')

